package transportManagement;

import java.io.Serializable;

import common.Date;

public class Transport implements Serializable {
	private static final long serialVersionUID = 3707537477219222532L;
	
	private String transportId;
	private String origin;
	private String destination;
	private Date departureDate;
	private Date arrivalDate;
	private double seatPrize;
	
	public Transport() {
		
	}
	
	public Transport(String transportId, String origin, String destination,
			Date departureDate, Date arrivalDate, double seatPrize) {
		this.setTransportId(transportId);
		this.setOrigin(origin);
		this.setDestination(destination);
		this.setDepartureDate(departureDate);
		this.setArrivalDate(arrivalDate);
		this.setSeatPrize(seatPrize);
	}
	
	public String getTransportId() {
		return transportId;
	}

	public void setTransportId(String transportId) {
		this.transportId = transportId;
	}

	public String getOrigin() {
		return origin;
	}

	public void setOrigin(String origin) {
		this.origin = origin;
	}

	public String getDestination() {
		return destination;
	}

	public void setDestination(String destination) {
		this.destination = destination;
	}

	public Date getDepartureDate() {
		return departureDate;
	}

	public void setDepartureDate(Date departureDate) {
		this.departureDate = departureDate;
	}

	public Date getArrivalDate() {
		return arrivalDate;
	}

	public void setArrivalDate(Date arrivalDate) {
		this.arrivalDate = arrivalDate;
	}

	public double getSeatPrize() {
		return seatPrize;
	}

	public void setSeatPrize(double seatPrize) {
		this.seatPrize = seatPrize;
	}
	
	@Override
	public boolean equals(Object object) {
		return object != null && 
				object instanceof Transport && 
				this.transportId.equalsIgnoreCase(((Transport)object).getTransportId());
	}

	@Override
	public String toString(){
		return "Transport[TransportId:" + this.getTransportId() + 
				";Origin:" + this.getOrigin() +
				";Destination:" + this.getDestination() + 
				";DepartureDate:" + this.getDepartureDate() + 
				";ArrivalDate:" + this.getArrivalDate() +
				";SeatPrize:" + this.getSeatPrize() +
				"]";
	}
}
